/*
 * @Author: your name
 * @Date: 2020-04-10 17:00:18
 * @LastEditTime: 2021-01-11 15:41:57
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \cellProject\src\modules\Front\data\mock\api\Cell\index.js
 */
import Mock from 'mockjs'

const data = {
  code: 200,
  message: '处理成功',
  data: {
    list: [
      {
        // 名称
        name: 'father1',
        // 负责人
        ower: 'shawn',
        // 进度
        per: 48,
        // 项目类型 1=> 里程碑 2=>计划项目 3=> 分组
        type: '3',
        // 计划周期
        planTime: ['2019/01/05', '2019/01/24'],
        stoneTime: '',
        startTime: '2019/01/05',
        endTime: '2019/01/24',
        id: '0-1-0',
        // 展开与否
        expand: true,
        // 显示与否
        isShow: true,
        // 后置依赖-依赖的子任务id数组集
        depends: [],
        // 后置依赖-依赖于谁(id)子任务的父级任务id
        dependPid: '',
        // 前置依赖-子集
        requireChild: [],
        // 前置依赖 父集id
        requireId: '',
        // 父级id
        parentId: ''
      },
      {
        name: 'child1',
        ower: 'xiao',
        per: 30,
        type: '2',
        planTime: [],
        stoneTime: '',
        startTime: '2019/01/05',
        endTime: '2019/01/12',
        id: '0-1-1',
        expand: true,
        isShow: true,
        // 目标连线id数组集
        depends: [{ id: '0-1-2' }, { id: '0-1-3' }],
        // 依赖于谁(id)
        dependPid: '',
        parentId: '0-1-0'
      },
      {
        name: 'child2',
        ower: 'dav',
        per: 40,
        type: '3',
        planTime: [],
        stoneTime: '',
        startTime: '2019/01/07',
        endTime: '2019/01/24',
        id: '0-1-4',
        expand: true,
        isShow: true,
        // 目标连线id数组集
        depends: [],
        // 依赖于谁(id)
        dependPid: '',
        parentId: '0-1-0'
      },
      {
        name: 'child2-1',
        ower: 'lili',
        per: 40,
        type: '2',
        planTime: [],
        stoneTime: '',
        startTime: '2019/01/07',
        endTime: '2019/01/15',
        id: '0-1-4-0',
        expand: true,
        isShow: true,
        // 目标连线id数组集
        depends: [],
        requireChild: [{ id: '0-1-4-1' }, { id: '0-1-4-2' }],
        // 依赖于谁(id)
        dependPid: '',
        parentId: '0-1-4'
      },
      {
        name: 'child2-2',
        ower: 'lili',
        per: 40,
        type: '2',
        planTime: [],
        stoneTime: '',
        startTime: '2019/01/16',
        endTime: '2019/01/24',
        id: '0-1-4-1',
        expand: true,
        isShow: true,
        // 目标连线id数组集
        depends: [],
        // 依赖于谁(id)
        dependPid: '',
        // 前置依赖的id
        requireId: '0-1-4-0',
        parentId: '0-1-4'
      },
      {
        name: 'child2-3',
        ower: 'lili',
        per: 40,
        type: '2',
        planTime: [],
        stoneTime: '',
        startTime: '2019/01/16',
        endTime: '2019/01/24',
        id: '0-1-4-2',
        expand: true,
        isShow: true,
        // 目标连线id数组集
        depends: [],
        // 依赖于谁(id)
        dependPid: '',
        // requireChild: [{
        //   id: '0-1-4-3',
        //   // 任务结束日期提前多少天开始依赖任务（可选）默认任务结束依赖项就开始
        //   advanceDays: 2
        // }],
        // 前置依赖的id
        requireId: '0-1-4-0',
        parentId: '0-1-4'
      },
      // {
      //   name: 'child2-4',
      //   ower: 'lili4',
      //   per: 40,
      //   type: '2',
      //   planTime: [],
      //   stoneTime: '',
      //   startTime: '2019/01/23',
      //   endTime: '2019/02/24',
      //   id: '0-1-4-3',
      //   expand: true,
      //   isShow: true,
      //   // 目标连线id数组集
      //   depends: [],
      //   // 依赖于谁(id)
      //   dependPid: '',
      //   // 前置依赖的id
      //   requireId: '0-1-4-2',
      //   parentId: '0-1-4'
      // },
      {
        name: 'child3',
        ower: 'jeke',
        per: 50,
        type: '2',
        planTime: [],
        stoneTime: '',
        startTime: '2019/01/06',
        endTime: '2019/01/14',
        id: '0-1-2',
        expand: true,
        isShow: true,
        // 依赖id数组集
        depends: [],
        // 指向谁(id)
        dependPid: '0-1-1',
        parentId: '0-1-0'
      },
      {
        name: 'child4',
        ower: '',
        per: 70,
        type: '2',
        planTime: [],
        stoneTime: '',
        startTime: '2019/01/14',
        endTime: '2019/01/21',
        id: '0-1-3',
        expand: true,
        isShow: true,
        depends: [],
        dependPid: '0-1-1',
        parentId: '0-1-0'
      },
      {
        name: 'father2',
        ower: '',
        per: 70,
        type: '2',
        planTime: [],
        stoneTime: '',
        startTime: '2019/01/02',
        endTime: '2019/01/10',
        id: '0-2-0',
        expand: true,
        isShow: true,
        depends: [],
        dependPid: '',
        parentId: ''
      }
    ],
    // leftMenu的右侧伸缩线
    rightLineX: 300,
    // 当前的时间大小,默认值
    currentDaySize: {
      label: '按天',
      value: 40,
      mode: 'day'
    },
    // 整体开始时间
    startTime: 1600473600000,
    // 整体结束时间
    endTime: 1600473600000,
    // 可配置字段属性
    fieldsAttr: {
      name: {
        label: '名称',
        showTable: true, // 是否于表格中显示该字段所在列
        showToast: true, // 是否于浮窗内显示该字段
        width: '150px', // 可选
        resizable: true // 可选
      },
      ower: { label: '负责人', showTable: true, showToast: false },
      per: {
        label: '进度',
        showTable: true,
        showToast: true,
        // 设置进度阶段的颜色(可选)
        processColors: [
          { 10: '#be2e55', 20: '#409eff', 50: '#13587e', 100: '#3eb88d' }
        ],
        // 连线选项背景色(可选)
        bgcolor: '#e4e7ed'
      },
      type: { label: '类型', showTable: false, showToast: false },
      startTime: { label: '开始时间', showTable: false, showToast: true },
      endTime: { label: '结束时间', showTable: false, showToast: true }
    }
  }
}

Mock.mock(/\/getTreeList/, data)
